package pcjavanet.mobilesell.service;

import java.util.List;

import pcjavanet.mobilesell.model.Eventcatalog; 
import pcjavanet.mobilesell.model.PageBean;
import pcjavanet.mobilesell.model.EventcatalogExample;
import pcjavanet.mobilesell.model.QryCondition;
import pcjavanet.mobilesell.model.QryTerm;
import pcjavanet.mobilesell.persistence.EventcatalogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class EventcatalogService {


  @Autowired
  private  EventcatalogMapper eventcatalogMapper;


  public int  insert( Eventcatalog eventcatalog ) throws Exception{
	return eventcatalogMapper.insert (eventcatalog);
  }


  public Eventcatalog  selectByPrimaryKey( Eventcatalog  bean ) {
 	int dbid = bean.getDbid();
	Eventcatalog eventcatalog = eventcatalogMapper.selectByPrimaryKey( dbid );
	return eventcatalog ;
  }


  public int  updateByPrimaryKeySelective( Eventcatalog eventcatalog ) throws Exception{
	return eventcatalogMapper.updateByPrimaryKeySelective( eventcatalog );
  }


  public int  deleteByPrimaryKey( Eventcatalog  bean ) throws Exception{
 	int dbid = bean.getDbid();
	return eventcatalogMapper.deleteByPrimaryKey( dbid );
  }


  public List<Eventcatalog>  selectByExample( Eventcatalog eventcatalog ) throws Exception{
    EventcatalogExample example = new EventcatalogExample();
	return eventcatalogMapper.selectByExample( example );
  }

  public List<Eventcatalog>  getOnePageBeans( QryCondition condition , PageBean pageBean ) throws Exception{
    EventcatalogExample example = new EventcatalogExample();
    ServiceUtil.dealCriteria( condition,  example.createCriteria() );
	List<Eventcatalog> ls=eventcatalogMapper.getOnePageBeans( example , pageBean );
//begin
	if ( ls.size() > 0 ) {
	}
//end
	return ls;
  }

  public int getTotalRecords( QryCondition condition , PageBean pageBean ) throws Exception{
    EventcatalogExample example = new EventcatalogExample();
    ServiceUtil.dealCriteria( condition,  example.createCriteria() );
	return eventcatalogMapper.getTotalRecords( example , pageBean );
  }

  public int countByExample( Eventcatalog eventcatalog , PageBean pageBean ){
    EventcatalogExample example = new EventcatalogExample();
	return eventcatalogMapper.countByExample( example );
  }
  public List<Eventcatalog> selectByExamplePage( Eventcatalog eventcatalog , PageBean pageBean ){
  EventcatalogExample example = new EventcatalogExample();
	return eventcatalogMapper.selectByExamplePage( example , pageBean );
  }

}
